{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# python数据分析期末项目\n",
    "- 项目人：黄南辉\n",
    "- 时间：2021年7月3日\n",
    "- 数据源：本项目使用了两个csv数据文件，一个是中国高校（大学）的数据，一个是中国高校专业设置的数据\n",
    "- 分析目标：分析中国目前高校（大学）办学状况、中国开设数量排名前20的热门专业和国家特色专业学校分布等关于高校办学的信息，为报志愿的高考生和想了解这方面信息的人提供参考"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 导入所用到的模块"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd \n",
    "from collections import Counter\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Map\n",
    "from pyecharts.faker import Faker\n",
    "from pyecharts.globals import ThemeType\n",
    "from pyecharts.charts import Pie\n",
    "from pyecharts.charts import Bar, Timeline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 读取数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 读取学校和专业数据\n",
    "df_学校 = pd.read_csv('data/school.csv',encoding='gbk')\n",
    "df_专业 = pd.read_csv('data/professional.csv',encoding='gbk')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学校</th>\n",
       "      <th>省份</th>\n",
       "      <th>城市</th>\n",
       "      <th>地址</th>\n",
       "      <th>水平层次</th>\n",
       "      <th>办学类别</th>\n",
       "      <th>办学类型</th>\n",
       "      <th>985</th>\n",
       "      <th>211</th>\n",
       "      <th>双一流</th>\n",
       "      <th>归属</th>\n",
       "      <th>开设专业链接</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>河北轨道运输职业技术学院</td>\n",
       "      <td>河北</td>\n",
       "      <td>石家庄市</td>\n",
       "      <td>河北省石家庄市经济技术开发区赣江路9号,石家庄市宁安路189号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>NaN</td>\n",
       "      <td>河北省</td>\n",
       "      <td>https://gkcx.eol.cn/school/2858/professional</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>厦门大学</td>\n",
       "      <td>福建</td>\n",
       "      <td>厦门市</td>\n",
       "      <td>福建省厦门市思明区思明南路422号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>教育部</td>\n",
       "      <td>https://gkcx.eol.cn/school/102/professional</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>四川大学</td>\n",
       "      <td>四川</td>\n",
       "      <td>成都市</td>\n",
       "      <td>四川省成都市一环路南一段24号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>教育部</td>\n",
       "      <td>https://gkcx.eol.cn/school/99/professional</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>武汉大学</td>\n",
       "      <td>湖北</td>\n",
       "      <td>武汉市</td>\n",
       "      <td>湖北省武汉市武昌区八一路299号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>教育部</td>\n",
       "      <td>https://gkcx.eol.cn/school/42/professional</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>北京大学</td>\n",
       "      <td>北京</td>\n",
       "      <td>北京市</td>\n",
       "      <td>北京市海淀区颐和园路5号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>教育部</td>\n",
       "      <td>https://gkcx.eol.cn/school/31/professional</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2851</th>\n",
       "      <td>甘孜职业学院</td>\n",
       "      <td>四川</td>\n",
       "      <td>甘孜藏族自治州</td>\n",
       "      <td>NaN</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>NaN</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>https://gkcx.eol.cn/school/3595/professional</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2852</th>\n",
       "      <td>郑州城建职业学院</td>\n",
       "      <td>河南</td>\n",
       "      <td>郑州市</td>\n",
       "      <td>NaN</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>NaN</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>https://gkcx.eol.cn/school/3582/professional</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2853</th>\n",
       "      <td>广西农业工程职业技术学院</td>\n",
       "      <td>广西</td>\n",
       "      <td>南宁市</td>\n",
       "      <td>中国-东盟南宁空港扶绥经济区空港大道东25号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>NaN</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>https://gkcx.eol.cn/school/3592/professional</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2854</th>\n",
       "      <td>北海康养职业学院</td>\n",
       "      <td>广西</td>\n",
       "      <td>北海市</td>\n",
       "      <td>北海市银海区金海岸大道666号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>NaN</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>https://gkcx.eol.cn/school/3593/professional</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2855</th>\n",
       "      <td>白银希望职业技术学院</td>\n",
       "      <td>甘肃</td>\n",
       "      <td>白银市</td>\n",
       "      <td>甘肃省白银市银西生态产业园南京路</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>NaN</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>https://gkcx.eol.cn/school/3601/professional</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2856 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                学校  省份       城市                               地址    水平层次 办学类别  \\\n",
       "0     河北轨道运输职业技术学院  河北     石家庄市  河北省石家庄市经济技术开发区赣江路9号,石家庄市宁安路189号  专科（高职）  理工类   \n",
       "1             厦门大学  福建      厦门市                福建省厦门市思明区思明南路422号    普通本科  综合类   \n",
       "2             四川大学  四川      成都市                  四川省成都市一环路南一段24号    普通本科  综合类   \n",
       "3             武汉大学  湖北      武汉市                 湖北省武汉市武昌区八一路299号    普通本科  综合类   \n",
       "4             北京大学  北京      北京市                     北京市海淀区颐和园路5号    普通本科  综合类   \n",
       "...            ...  ..      ...                              ...     ...  ...   \n",
       "2851        甘孜职业学院  四川  甘孜藏族自治州                              NaN  专科（高职）  NaN   \n",
       "2852      郑州城建职业学院  河南      郑州市                              NaN  专科（高职）  NaN   \n",
       "2853  广西农业工程职业技术学院  广西      南宁市           中国-东盟南宁空港扶绥经济区空港大道东25号  专科（高职）  NaN   \n",
       "2854      北海康养职业学院  广西      北海市                  北海市银海区金海岸大道666号  专科（高职）  NaN   \n",
       "2855    白银希望职业技术学院  甘肃      白银市                 甘肃省白银市银西生态产业园南京路  专科（高职）  NaN   \n",
       "\n",
       "     办学类型 985 211  双一流   归属                                        开设专业链接  \n",
       "0      公办   否   否  NaN  河北省  https://gkcx.eol.cn/school/2858/professional  \n",
       "1      公办   是   是    是  教育部   https://gkcx.eol.cn/school/102/professional  \n",
       "2      公办   是   是    是  教育部    https://gkcx.eol.cn/school/99/professional  \n",
       "3      公办   是   是    是  教育部    https://gkcx.eol.cn/school/42/professional  \n",
       "4      公办   是   是    是  教育部    https://gkcx.eol.cn/school/31/professional  \n",
       "...   ...  ..  ..  ...  ...                                           ...  \n",
       "2851   公办   否   否  NaN  NaN  https://gkcx.eol.cn/school/3595/professional  \n",
       "2852   民办   否   否  NaN  NaN  https://gkcx.eol.cn/school/3582/professional  \n",
       "2853   公办   否   否  NaN  NaN  https://gkcx.eol.cn/school/3592/professional  \n",
       "2854   民办   否   否  NaN  NaN  https://gkcx.eol.cn/school/3593/professional  \n",
       "2855   民办   否   否  NaN  NaN  https://gkcx.eol.cn/school/3601/professional  \n",
       "\n",
       "[2856 rows x 12 columns]"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_学校"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 删除无用数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_学校.drop(['归属','开设专业链接'],axis=1,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学校</th>\n",
       "      <th>省份</th>\n",
       "      <th>城市</th>\n",
       "      <th>地址</th>\n",
       "      <th>水平层次</th>\n",
       "      <th>办学类别</th>\n",
       "      <th>办学类型</th>\n",
       "      <th>985</th>\n",
       "      <th>211</th>\n",
       "      <th>双一流</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>河北轨道运输职业技术学院</td>\n",
       "      <td>河北</td>\n",
       "      <td>石家庄市</td>\n",
       "      <td>河北省石家庄市经济技术开发区赣江路9号,石家庄市宁安路189号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>厦门大学</td>\n",
       "      <td>福建</td>\n",
       "      <td>厦门市</td>\n",
       "      <td>福建省厦门市思明区思明南路422号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>四川大学</td>\n",
       "      <td>四川</td>\n",
       "      <td>成都市</td>\n",
       "      <td>四川省成都市一环路南一段24号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>武汉大学</td>\n",
       "      <td>湖北</td>\n",
       "      <td>武汉市</td>\n",
       "      <td>湖北省武汉市武昌区八一路299号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>北京大学</td>\n",
       "      <td>北京</td>\n",
       "      <td>北京市</td>\n",
       "      <td>北京市海淀区颐和园路5号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2851</th>\n",
       "      <td>甘孜职业学院</td>\n",
       "      <td>四川</td>\n",
       "      <td>甘孜藏族自治州</td>\n",
       "      <td>NaN</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>NaN</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2852</th>\n",
       "      <td>郑州城建职业学院</td>\n",
       "      <td>河南</td>\n",
       "      <td>郑州市</td>\n",
       "      <td>NaN</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>NaN</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2853</th>\n",
       "      <td>广西农业工程职业技术学院</td>\n",
       "      <td>广西</td>\n",
       "      <td>南宁市</td>\n",
       "      <td>中国-东盟南宁空港扶绥经济区空港大道东25号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>NaN</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2854</th>\n",
       "      <td>北海康养职业学院</td>\n",
       "      <td>广西</td>\n",
       "      <td>北海市</td>\n",
       "      <td>北海市银海区金海岸大道666号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>NaN</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2855</th>\n",
       "      <td>白银希望职业技术学院</td>\n",
       "      <td>甘肃</td>\n",
       "      <td>白银市</td>\n",
       "      <td>甘肃省白银市银西生态产业园南京路</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>NaN</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2856 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                学校  省份       城市                               地址    水平层次 办学类别  \\\n",
       "0     河北轨道运输职业技术学院  河北     石家庄市  河北省石家庄市经济技术开发区赣江路9号,石家庄市宁安路189号  专科（高职）  理工类   \n",
       "1             厦门大学  福建      厦门市                福建省厦门市思明区思明南路422号    普通本科  综合类   \n",
       "2             四川大学  四川      成都市                  四川省成都市一环路南一段24号    普通本科  综合类   \n",
       "3             武汉大学  湖北      武汉市                 湖北省武汉市武昌区八一路299号    普通本科  综合类   \n",
       "4             北京大学  北京      北京市                     北京市海淀区颐和园路5号    普通本科  综合类   \n",
       "...            ...  ..      ...                              ...     ...  ...   \n",
       "2851        甘孜职业学院  四川  甘孜藏族自治州                              NaN  专科（高职）  NaN   \n",
       "2852      郑州城建职业学院  河南      郑州市                              NaN  专科（高职）  NaN   \n",
       "2853  广西农业工程职业技术学院  广西      南宁市           中国-东盟南宁空港扶绥经济区空港大道东25号  专科（高职）  NaN   \n",
       "2854      北海康养职业学院  广西      北海市                  北海市银海区金海岸大道666号  专科（高职）  NaN   \n",
       "2855    白银希望职业技术学院  甘肃      白银市                 甘肃省白银市银西生态产业园南京路  专科（高职）  NaN   \n",
       "\n",
       "     办学类型 985 211  双一流  \n",
       "0      公办   否   否  NaN  \n",
       "1      公办   是   是    是  \n",
       "2      公办   是   是    是  \n",
       "3      公办   是   是    是  \n",
       "4      公办   是   是    是  \n",
       "...   ...  ..  ..  ...  \n",
       "2851   公办   否   否  NaN  \n",
       "2852   民办   否   否  NaN  \n",
       "2853   公办   否   否  NaN  \n",
       "2854   民办   否   否  NaN  \n",
       "2855   民办   否   否  NaN  \n",
       "\n",
       "[2856 rows x 10 columns]"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_学校"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 分析各省大学数量分布情况"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "      省份            学校\n",
      "0     河北  河北轨道运输职业技术学院\n",
      "1     福建          厦门大学\n",
      "2     四川          四川大学\n",
      "3     湖北          武汉大学\n",
      "4     北京          北京大学\n",
      "...   ..           ...\n",
      "2851  四川        甘孜职业学院\n",
      "2852  河南      郑州城建职业学院\n",
      "2853  广西  广西农业工程职业技术学院\n",
      "2854  广西      北海康养职业学院\n",
      "2855  甘肃    白银希望职业技术学院\n",
      "\n",
      "[2856 rows x 2 columns]\n"
     ]
    }
   ],
   "source": [
    "print(df_学校[['省份','学校']])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 按省份对数据进行分组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>城市</th>\n",
       "      <th>地址</th>\n",
       "      <th>水平层次</th>\n",
       "      <th>办学类别</th>\n",
       "      <th>办学类型</th>\n",
       "      <th>985</th>\n",
       "      <th>211</th>\n",
       "      <th>双一流</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>省份</th>\n",
       "      <th>学校</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">上海</th>\n",
       "      <th>上海东海职业技术学院</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市闵行区虹梅南路6001号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>综合类</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>上海中侨职业技术大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市金山区漕廊公路3888号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>财经类</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>上海中医药大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市浦东新区蔡伦路1200号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>医药类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>上海交通大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市东川路800号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>上海交通大学医学院</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市重庆南路227号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>医药类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">黑龙江</th>\n",
       "      <th>齐齐哈尔医学院</th>\n",
       "      <td>齐齐哈尔市</td>\n",
       "      <td>齐齐哈尔市建华卜奎北大街333号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>医药类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>齐齐哈尔大学</th>\n",
       "      <td>齐齐哈尔市</td>\n",
       "      <td>黑龙江省齐齐哈尔市建华区文化大街42号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>齐齐哈尔工程学院</th>\n",
       "      <td>齐齐哈尔市</td>\n",
       "      <td>黑龙江省齐齐哈尔市喜庆路1号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>齐齐哈尔理工职业学院</th>\n",
       "      <td>齐齐哈尔市</td>\n",
       "      <td>齐齐哈尔市富拉尔基区和平大街249号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>理工类</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>齐齐哈尔高等师范专科学校</th>\n",
       "      <td>齐齐哈尔市</td>\n",
       "      <td>黑龙江省齐齐哈尔市民航路566号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>师范类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2856 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                     城市                   地址    水平层次 办学类别 办学类型 985 211 双一流\n",
       "省份  学校                                                                    \n",
       "上海  上海东海职业技术学院      上海市      上海市闵行区虹梅南路6001号  专科（高职）  综合类   民办   否   否   0\n",
       "    上海中侨职业技术大学      上海市      上海市金山区漕廊公路3888号    普通本科  财经类   民办   否   否   0\n",
       "    上海中医药大学         上海市      上海市浦东新区蔡伦路1200号    普通本科  医药类   公办   否   否   是\n",
       "    上海交通大学          上海市           上海市东川路800号    普通本科  综合类   公办   是   是   是\n",
       "    上海交通大学医学院       上海市          上海市重庆南路227号    普通本科  医药类   公办   否   否   0\n",
       "...                 ...                  ...     ...  ...  ...  ..  ..  ..\n",
       "黑龙江 齐齐哈尔医学院       齐齐哈尔市     齐齐哈尔市建华卜奎北大街333号    普通本科  医药类   公办   否   否   0\n",
       "    齐齐哈尔大学        齐齐哈尔市  黑龙江省齐齐哈尔市建华区文化大街42号    普通本科  综合类   公办   否   否   0\n",
       "    齐齐哈尔工程学院      齐齐哈尔市       黑龙江省齐齐哈尔市喜庆路1号    普通本科  综合类   民办   否   否   0\n",
       "    齐齐哈尔理工职业学院    齐齐哈尔市   齐齐哈尔市富拉尔基区和平大街249号  专科（高职）  理工类   民办   否   否   0\n",
       "    齐齐哈尔高等师范专科学校  齐齐哈尔市     黑龙江省齐齐哈尔市民航路566号  专科（高职）  师范类   公办   否   否   0\n",
       "\n",
       "[2856 rows x 8 columns]"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 使用groupby按省份对学校分组\n",
    "province_学校 = df_学校.groupby(['省份','学校']).sum()\n",
    "province_学校"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 统计各省学校数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'河北': 126,\n",
       " '福建': 90,\n",
       " '四川': 137,\n",
       " '湖北': 134,\n",
       " '北京': 102,\n",
       " '广东': 163,\n",
       " '湖南': 129,\n",
       " '江苏': 174,\n",
       " '重庆': 73,\n",
       " '浙江': 111,\n",
       " '山东': 160,\n",
       " '天津': 62,\n",
       " '上海': 65,\n",
       " '河南': 158,\n",
       " '吉林': 70,\n",
       " '陕西': 104,\n",
       " '辽宁': 110,\n",
       " '海南': 21,\n",
       " '江西': 108,\n",
       " '黑龙江': 81,\n",
       " '甘肃': 52,\n",
       " '云南': 82,\n",
       " '安徽': 128,\n",
       " '山西': 85,\n",
       " '广西': 85,\n",
       " '贵州': 77,\n",
       " '新疆': 56,\n",
       " '内蒙古': 56,\n",
       " '宁夏': 20,\n",
       " '青海': 12,\n",
       " '西藏': 6,\n",
       " '香港': 14,\n",
       " '澳门': 5}"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 使用collections的Counter函数统计各省学校数量\n",
    "province = list(df_学校[\"省份\"])\n",
    "province_学校数量 = dict(Counter(province))\n",
    "province_学校数量"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 构建各省学校数量的DataFrame表格"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['河北',\n",
       " '福建',\n",
       " '四川',\n",
       " '湖北',\n",
       " '北京',\n",
       " '广东',\n",
       " '湖南',\n",
       " '江苏',\n",
       " '重庆',\n",
       " '浙江',\n",
       " '山东',\n",
       " '天津',\n",
       " '上海',\n",
       " '河南',\n",
       " '吉林',\n",
       " '陕西',\n",
       " '辽宁',\n",
       " '海南',\n",
       " '江西',\n",
       " '黑龙江',\n",
       " '甘肃',\n",
       " '云南',\n",
       " '安徽',\n",
       " '山西',\n",
       " '广西',\n",
       " '贵州',\n",
       " '新疆',\n",
       " '内蒙古',\n",
       " '宁夏',\n",
       " '青海',\n",
       " '西藏',\n",
       " '香港',\n",
       " '澳门']"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "省份_list = list(province_学校数量.keys())\n",
    "省份_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[126,\n",
       " 90,\n",
       " 137,\n",
       " 134,\n",
       " 102,\n",
       " 163,\n",
       " 129,\n",
       " 174,\n",
       " 73,\n",
       " 111,\n",
       " 160,\n",
       " 62,\n",
       " 65,\n",
       " 158,\n",
       " 70,\n",
       " 104,\n",
       " 110,\n",
       " 21,\n",
       " 108,\n",
       " 81,\n",
       " 52,\n",
       " 82,\n",
       " 128,\n",
       " 85,\n",
       " 85,\n",
       " 77,\n",
       " 56,\n",
       " 56,\n",
       " 20,\n",
       " 12,\n",
       " 6,\n",
       " 14,\n",
       " 5]"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "学校数量_list = list(province_学校数量.values())\n",
    "学校数量_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>省份</th>\n",
       "      <th>学校数量</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>河北</td>\n",
       "      <td>126</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>福建</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>四川</td>\n",
       "      <td>137</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>湖北</td>\n",
       "      <td>134</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>北京</td>\n",
       "      <td>102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>广东</td>\n",
       "      <td>163</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>湖南</td>\n",
       "      <td>129</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>江苏</td>\n",
       "      <td>174</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>重庆</td>\n",
       "      <td>73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>浙江</td>\n",
       "      <td>111</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>山东</td>\n",
       "      <td>160</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>天津</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>上海</td>\n",
       "      <td>65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>河南</td>\n",
       "      <td>158</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>吉林</td>\n",
       "      <td>70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>陕西</td>\n",
       "      <td>104</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>辽宁</td>\n",
       "      <td>110</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>海南</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>江西</td>\n",
       "      <td>108</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>甘肃</td>\n",
       "      <td>52</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>云南</td>\n",
       "      <td>82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>安徽</td>\n",
       "      <td>128</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>山西</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>广西</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>贵州</td>\n",
       "      <td>77</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>新疆</td>\n",
       "      <td>56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>内蒙古</td>\n",
       "      <td>56</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>宁夏</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>青海</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>西藏</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>香港</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>澳门</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     省份  学校数量\n",
       "0    河北   126\n",
       "1    福建    90\n",
       "2    四川   137\n",
       "3    湖北   134\n",
       "4    北京   102\n",
       "5    广东   163\n",
       "6    湖南   129\n",
       "7    江苏   174\n",
       "8    重庆    73\n",
       "9    浙江   111\n",
       "10   山东   160\n",
       "11   天津    62\n",
       "12   上海    65\n",
       "13   河南   158\n",
       "14   吉林    70\n",
       "15   陕西   104\n",
       "16   辽宁   110\n",
       "17   海南    21\n",
       "18   江西   108\n",
       "19  黑龙江    81\n",
       "20   甘肃    52\n",
       "21   云南    82\n",
       "22   安徽   128\n",
       "23   山西    85\n",
       "24   广西    85\n",
       "25   贵州    77\n",
       "26   新疆    56\n",
       "27  内蒙古    56\n",
       "28   宁夏    20\n",
       "29   青海    12\n",
       "30   西藏     6\n",
       "31   香港    14\n",
       "32   澳门     5"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 构建各省学校数量的DataFrame表格\n",
    "df_各省学校数量 = pd.DataFrame({'省份':省份_list,'学校数量':学校数量_list})\n",
    "df_各省学校数量"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 绘制各省学校数量可视化图\n",
    "- 使用pyecharts的Map函数绘制地图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'china':'https://assets.pyecharts.org/assets/maps/china', 'essos':'https://assets.pyecharts.org/assets/themes/essos'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"820f117fea324f278572a5e8b02af0c1\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china', 'essos'], function(echarts) {\n",
       "                var chart_820f117fea324f278572a5e8b02af0c1 = echarts.init(\n",
       "                    document.getElementById('820f117fea324f278572a5e8b02af0c1'), 'essos', {renderer: 'canvas'});\n",
       "                var option_820f117fea324f278572a5e8b02af0c1 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"map\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"mapType\": \"china\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5317\",\n",
       "                    \"value\": 126\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u798f\\u5efa\",\n",
       "                    \"value\": 90\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u56db\\u5ddd\",\n",
       "                    \"value\": 137\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5317\",\n",
       "                    \"value\": 134\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": 102\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": 163\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": 129\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": 174\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u5e86\",\n",
       "                    \"value\": 73\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": 111\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u4e1c\",\n",
       "                    \"value\": 160\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5929\\u6d25\",\n",
       "                    \"value\": 62\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": 65\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5357\",\n",
       "                    \"value\": 158\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5409\\u6797\",\n",
       "                    \"value\": 70\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9655\\u897f\",\n",
       "                    \"value\": 104\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8fbd\\u5b81\",\n",
       "                    \"value\": 110\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d77\\u5357\",\n",
       "                    \"value\": 21\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": 108\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9ed1\\u9f99\\u6c5f\",\n",
       "                    \"value\": 81\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7518\\u8083\",\n",
       "                    \"value\": 52\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e91\\u5357\",\n",
       "                    \"value\": 82\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b89\\u5fbd\",\n",
       "                    \"value\": 128\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u897f\",\n",
       "                    \"value\": 85\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u897f\",\n",
       "                    \"value\": 85\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8d35\\u5dde\",\n",
       "                    \"value\": 77\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u65b0\\u7586\",\n",
       "                    \"value\": 56\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5185\\u8499\\u53e4\",\n",
       "                    \"value\": 56\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b81\\u590f\",\n",
       "                    \"value\": 20\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9752\\u6d77\",\n",
       "                    \"value\": 12\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u897f\\u85cf\",\n",
       "                    \"value\": 6\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9999\\u6e2f\",\n",
       "                    \"value\": 14\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6fb3\\u95e8\",\n",
       "                    \"value\": 5\n",
       "                }\n",
       "            ],\n",
       "            \"roam\": true,\n",
       "            \"aspectScale\": 0.75,\n",
       "            \"nameProperty\": \"name\",\n",
       "            \"selectedMode\": false,\n",
       "            \"zoom\": 1,\n",
       "            \"mapValueCalculation\": \"sum\",\n",
       "            \"showLegendSymbol\": true,\n",
       "            \"emphasis\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u9ad8\\u6821\\u5206\\u5e03\\u5730\\u533a\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"piecewise\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 200,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 14,\n",
       "        \"borderWidth\": 0\n",
       "    }\n",
       "};\n",
       "                chart_820f117fea324f278572a5e8b02af0c1.setOption(option_820f117fea324f278572a5e8b02af0c1);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1dcaba02370>"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p = 省份_list\n",
    "v = 学校数量_list\n",
    "c = (\n",
    "    Map(init_opts=opts.InitOpts(theme=ThemeType.ESSOS))\n",
    "    .add(\"\", [list(z) for z in zip(p,v)], \"china\")\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"高校分布地区\"),\n",
    "        visualmap_opts=opts.VisualMapOpts(max_=200, is_piecewise=True),\n",
    "    )\n",
    ")\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 分析本科、专科占比情况"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 统计本科和专科数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>水平层次</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>1499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>普通本科</td>\n",
       "      <td>1357</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    index  水平层次\n",
       "0  专科（高职）  1499\n",
       "1    普通本科  1357"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_本专科数量 = df_学校['水平层次'].value_counts().reset_index()\n",
    "df_本专科数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 重设列名，获得本专科数量表格\n",
    "df_本专科数量.rename(columns = {'index':'水平层次','水平层次':'数量'},inplace = True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>水平层次</th>\n",
       "      <th>数量</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>1499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>普通本科</td>\n",
       "      <td>1357</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     水平层次    数量\n",
       "0  专科（高职）  1499\n",
       "1    普通本科  1357"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_本专科数量"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 构建本科、专科学校表格"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>省份</th>\n",
       "      <th>城市</th>\n",
       "      <th>地址</th>\n",
       "      <th>办学类别</th>\n",
       "      <th>办学类型</th>\n",
       "      <th>985</th>\n",
       "      <th>211</th>\n",
       "      <th>双一流</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>水平层次</th>\n",
       "      <th>学校</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">专科（高职）</th>\n",
       "      <th>七台河职业学院</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>七台河市</td>\n",
       "      <td>黑龙江省七台河市桃山区学府街229号</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>三亚中瑞酒店管理职业学院</th>\n",
       "      <td>海南</td>\n",
       "      <td>三亚市</td>\n",
       "      <td>海南省三亚市海棠区湾坡路108号</td>\n",
       "      <td>综合类</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>三亚城市职业学院</th>\n",
       "      <td>海南</td>\n",
       "      <td>三亚市</td>\n",
       "      <td>海南省三亚市吉阳区抱坡路100号</td>\n",
       "      <td>综合类</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>三亚理工职业学院</th>\n",
       "      <td>海南</td>\n",
       "      <td>三亚市</td>\n",
       "      <td>海南省三亚市迎宾大道学院路</td>\n",
       "      <td>理工类</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>三亚航空旅游职业学院</th>\n",
       "      <td>海南</td>\n",
       "      <td>三亚市</td>\n",
       "      <td>海南省三亚市凤凰路218号</td>\n",
       "      <td>理工类</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">普通本科</th>\n",
       "      <th>齐鲁理工学院</th>\n",
       "      <td>山东</td>\n",
       "      <td>济南市</td>\n",
       "      <td>山东省济南市经十东路3028号,曲阜校区：山东省曲阜市有朋路105号</td>\n",
       "      <td>综合类</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>齐齐哈尔医学院</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>齐齐哈尔市</td>\n",
       "      <td>齐齐哈尔市建华卜奎北大街333号</td>\n",
       "      <td>医药类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>齐齐哈尔大学</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>齐齐哈尔市</td>\n",
       "      <td>黑龙江省齐齐哈尔市建华区文化大街42号</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>齐齐哈尔工程学院</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>齐齐哈尔市</td>\n",
       "      <td>黑龙江省齐齐哈尔市喜庆路1号</td>\n",
       "      <td>综合类</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>龙岩学院</th>\n",
       "      <td>福建</td>\n",
       "      <td>龙岩市</td>\n",
       "      <td>福建省龙岩市东肖北路1号</td>\n",
       "      <td>其他</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2856 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                      省份     城市                                  地址 办学类别 办学类型  \\\n",
       "水平层次   学校                                                                       \n",
       "专科（高职） 七台河职业学院       黑龙江   七台河市                  黑龙江省七台河市桃山区学府街229号  综合类   公办   \n",
       "       三亚中瑞酒店管理职业学院   海南    三亚市                    海南省三亚市海棠区湾坡路108号  综合类   民办   \n",
       "       三亚城市职业学院       海南    三亚市                    海南省三亚市吉阳区抱坡路100号  综合类   民办   \n",
       "       三亚理工职业学院       海南    三亚市                       海南省三亚市迎宾大道学院路  理工类   民办   \n",
       "       三亚航空旅游职业学院     海南    三亚市                       海南省三亚市凤凰路218号  理工类   民办   \n",
       "...                  ...    ...                                 ...  ...  ...   \n",
       "普通本科   齐鲁理工学院         山东    济南市  山东省济南市经十东路3028号,曲阜校区：山东省曲阜市有朋路105号  综合类   民办   \n",
       "       齐齐哈尔医学院       黑龙江  齐齐哈尔市                    齐齐哈尔市建华卜奎北大街333号  医药类   公办   \n",
       "       齐齐哈尔大学        黑龙江  齐齐哈尔市                 黑龙江省齐齐哈尔市建华区文化大街42号  综合类   公办   \n",
       "       齐齐哈尔工程学院      黑龙江  齐齐哈尔市                      黑龙江省齐齐哈尔市喜庆路1号  综合类   民办   \n",
       "       龙岩学院           福建    龙岩市                        福建省龙岩市东肖北路1号   其他   公办   \n",
       "\n",
       "                    985 211 双一流  \n",
       "水平层次   学校                        \n",
       "专科（高职） 七台河职业学院        否   否   0  \n",
       "       三亚中瑞酒店管理职业学院   否   否   0  \n",
       "       三亚城市职业学院       否   否   0  \n",
       "       三亚理工职业学院       否   否   0  \n",
       "       三亚航空旅游职业学院     否   否   0  \n",
       "...                  ..  ..  ..  \n",
       "普通本科   齐鲁理工学院         否   否   0  \n",
       "       齐齐哈尔医学院        否   否   0  \n",
       "       齐齐哈尔大学         否   否   0  \n",
       "       齐齐哈尔工程学院       否   否   0  \n",
       "       龙岩学院           否   否   0  \n",
       "\n",
       "[2856 rows x 8 columns]"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_本专科学校 = df_学校.groupby(['水平层次','学校']).sum()\n",
    "df_本专科学校"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 绘制本科、专科占比可视化图\n",
    "- 使用pyecharts的Pie函数绘制饼图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['专科（高职）', '普通本科'] [1499, 1357]\n"
     ]
    }
   ],
   "source": [
    "l = list(df_本专科数量['水平层次'])\n",
    "v = list(df_本专科数量['数量'])\n",
    "print(l,v)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'essos':'https://assets.pyecharts.org/assets/themes/essos'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"77c4c2d090414d819db87c57a8a2edd7\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'essos'], function(echarts) {\n",
       "                var chart_77c4c2d090414d819db87c57a8a2edd7 = echarts.init(\n",
       "                    document.getElementById('77c4c2d090414d819db87c57a8a2edd7'), 'essos', {renderer: 'canvas'});\n",
       "                var option_77c4c2d090414d819db87c57a8a2edd7 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u4e13\\u79d1\\uff08\\u9ad8\\u804c\\uff09\",\n",
       "                    \"value\": 1499\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u666e\\u901a\\u672c\\u79d1\",\n",
       "                    \"value\": 1357\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"40%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}: {c}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u4e13\\u79d1\\uff08\\u9ad8\\u804c\\uff09\",\n",
       "                \"\\u666e\\u901a\\u672c\\u79d1\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"left\": \"2%\",\n",
       "            \"top\": \"15%\",\n",
       "            \"orient\": \"vertical\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u672c/\\u4e13\\u79d1\\u5360\\u6bd4\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_77c4c2d090414d819db87c57a8a2edd7.setOption(option_77c4c2d090414d819db87c57a8a2edd7);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1dcabc92250>"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = (\n",
    "    Pie(init_opts=opts.InitOpts(theme=ThemeType.ESSOS))\n",
    "    .add(\n",
    "        \"\",\n",
    "        [list(z) for z in zip(l,v)],\n",
    "        radius=[\"40%\", \"75%\"],\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"本/专科占比\"),\n",
    "        legend_opts=opts.LegendOpts(orient=\"vertical\", pos_top=\"15%\", pos_left=\"2%\"),\n",
    "    )\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}: {c}\"))\n",
    ")\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 分析办学类别占比情况"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 统计各个办学类别数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>办学类别</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>理工类</td>\n",
       "      <td>865</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>综合类</td>\n",
       "      <td>828</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>师范类</td>\n",
       "      <td>242</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>医药类</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>财经类</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>艺术类</td>\n",
       "      <td>106</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>农林类</td>\n",
       "      <td>87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>政法类</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>军事类</td>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>其他</td>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>语言类</td>\n",
       "      <td>38</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>体育类</td>\n",
       "      <td>35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>民族类</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   index  办学类别\n",
       "0    理工类   865\n",
       "1    综合类   828\n",
       "2    师范类   242\n",
       "3    医药类   216\n",
       "4    财经类   216\n",
       "5    艺术类   106\n",
       "6    农林类    87\n",
       "7    政法类    68\n",
       "8    军事类    55\n",
       "9     其他    55\n",
       "10   语言类    38\n",
       "11   体育类    35\n",
       "12   民族类    15"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_办学类别数量 = df_学校['办学类别'].value_counts().reset_index()\n",
    "df_办学类别数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 重设列名，获得各个办学类别数量表格\n",
    "df_办学类别数量.rename(columns = {'index':'办学类别','办学类别':'数量'},inplace = True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>办学类别</th>\n",
       "      <th>数量</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>理工类</td>\n",
       "      <td>865</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>综合类</td>\n",
       "      <td>828</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>师范类</td>\n",
       "      <td>242</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>医药类</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>财经类</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>艺术类</td>\n",
       "      <td>106</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>农林类</td>\n",
       "      <td>87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>政法类</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>军事类</td>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>其他</td>\n",
       "      <td>55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>语言类</td>\n",
       "      <td>38</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>体育类</td>\n",
       "      <td>35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>民族类</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   办学类别   数量\n",
       "0   理工类  865\n",
       "1   综合类  828\n",
       "2   师范类  242\n",
       "3   医药类  216\n",
       "4   财经类  216\n",
       "5   艺术类  106\n",
       "6   农林类   87\n",
       "7   政法类   68\n",
       "8   军事类   55\n",
       "9    其他   55\n",
       "10  语言类   38\n",
       "11  体育类   35\n",
       "12  民族类   15"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_办学类别数量"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 构建各个办学类别学校表格"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>省份</th>\n",
       "      <th>城市</th>\n",
       "      <th>地址</th>\n",
       "      <th>水平层次</th>\n",
       "      <th>办学类型</th>\n",
       "      <th>985</th>\n",
       "      <th>211</th>\n",
       "      <th>双一流</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>办学类别</th>\n",
       "      <th>学校</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">体育类</th>\n",
       "      <th>上海体育学院</th>\n",
       "      <td>上海</td>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市杨浦区清源环路650号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>云南体育运动职业技术学院</th>\n",
       "      <td>云南</td>\n",
       "      <td>昆明市</td>\n",
       "      <td>云南昆明海埂体院路3号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>内蒙古体育职业学院</th>\n",
       "      <td>内蒙古</td>\n",
       "      <td>呼和浩特市</td>\n",
       "      <td>内蒙古呼和浩特市新城区成吉思汗大街19号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>北京体育大学</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京市</td>\n",
       "      <td>北京市海淀区信息路48号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>北京体育职业学院</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京市</td>\n",
       "      <td>院本部：北京市丰台区光彩北路4号,分校区：北京市大兴区芦城乡政府路21号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">财经类</th>\n",
       "      <th>陕西财经职业技术学院</th>\n",
       "      <td>陕西</td>\n",
       "      <td>咸阳市</td>\n",
       "      <td>陕西省咸阳市文林路1号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>首都经济贸易大学</th>\n",
       "      <td>北京</td>\n",
       "      <td>北京市</td>\n",
       "      <td>校本部位于北京市丰台区花乡张家路口121号,红庙校区位于北京市朝阳门外金台里2号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>黑龙江商业职业学院</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>牡丹江市</td>\n",
       "      <td>黑龙江省牡丹江市爱民区西圣林街333号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>黑龙江旅游职业技术学院</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>哈尔滨市</td>\n",
       "      <td>黑龙江省哈尔滨市南岗区学府路315号</td>\n",
       "      <td>专科（高职）</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>黑龙江财经学院</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>哈尔滨市</td>\n",
       "      <td>哈尔滨市利民开发区学院路99号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>民办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2826 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                    省份     城市                                        地址  \\\n",
       "办学类别 学校                                                                   \n",
       "体育类  上海体育学院         上海    上海市                            上海市杨浦区清源环路650号   \n",
       "     云南体育运动职业技术学院   云南    昆明市                               云南昆明海埂体院路3号   \n",
       "     内蒙古体育职业学院     内蒙古  呼和浩特市                      内蒙古呼和浩特市新城区成吉思汗大街19号   \n",
       "     北京体育大学         北京    北京市                              北京市海淀区信息路48号   \n",
       "     北京体育职业学院       北京    北京市      院本部：北京市丰台区光彩北路4号,分校区：北京市大兴区芦城乡政府路21号   \n",
       "...                ...    ...                                       ...   \n",
       "财经类  陕西财经职业技术学院     陕西    咸阳市                               陕西省咸阳市文林路1号   \n",
       "     首都经济贸易大学       北京    北京市  校本部位于北京市丰台区花乡张家路口121号,红庙校区位于北京市朝阳门外金台里2号   \n",
       "     黑龙江商业职业学院     黑龙江   牡丹江市                       黑龙江省牡丹江市爱民区西圣林街333号   \n",
       "     黑龙江旅游职业技术学院   黑龙江   哈尔滨市                        黑龙江省哈尔滨市南岗区学府路315号   \n",
       "     黑龙江财经学院       黑龙江   哈尔滨市                           哈尔滨市利民开发区学院路99号   \n",
       "\n",
       "                     水平层次 办学类型 985 211 双一流  \n",
       "办学类别 学校                                     \n",
       "体育类  上海体育学院          普通本科   公办   否   否   是  \n",
       "     云南体育运动职业技术学院  专科（高职）   公办   否   否   0  \n",
       "     内蒙古体育职业学院     专科（高职）   公办   否   否   0  \n",
       "     北京体育大学          普通本科   公办   否   是   是  \n",
       "     北京体育职业学院      专科（高职）   公办   否   否   0  \n",
       "...                   ...  ...  ..  ..  ..  \n",
       "财经类  陕西财经职业技术学院    专科（高职）   公办   否   否   0  \n",
       "     首都经济贸易大学        普通本科   公办   否   否   0  \n",
       "     黑龙江商业职业学院     专科（高职）   公办   否   否   0  \n",
       "     黑龙江旅游职业技术学院   专科（高职）   公办   否   否   0  \n",
       "     黑龙江财经学院         普通本科   民办   否   否   0  \n",
       "\n",
       "[2826 rows x 8 columns]"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_办学类别学校 = df_学校.groupby(['办学类别','学校']).sum()\n",
    "df_办学类别学校"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 绘制各个办学类别占比可视化图\n",
    "- 使用pyecharts的Pie函数绘制饼图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['理工类', '综合类', '师范类', '医药类', '财经类', '艺术类', '农林类', '政法类', '军事类', '其他', '语言类', '体育类', '民族类'] [865, 828, 242, 216, 216, 106, 87, 68, 55, 55, 38, 35, 15]\n"
     ]
    }
   ],
   "source": [
    "l = list(df_办学类别数量['办学类别'])\n",
    "v = list(df_办学类别数量['数量'])\n",
    "print(l,v)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'essos':'https://assets.pyecharts.org/assets/themes/essos'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"da4a9534ff734f29bdf132adbef9c735\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'essos'], function(echarts) {\n",
       "                var chart_da4a9534ff734f29bdf132adbef9c735 = echarts.init(\n",
       "                    document.getElementById('da4a9534ff734f29bdf132adbef9c735'), 'essos', {renderer: 'canvas'});\n",
       "                var option_da4a9534ff734f29bdf132adbef9c735 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u7406\\u5de5\\u7c7b\",\n",
       "                    \"value\": 865\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7efc\\u5408\\u7c7b\",\n",
       "                    \"value\": 828\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e08\\u8303\\u7c7b\",\n",
       "                    \"value\": 242\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u533b\\u836f\\u7c7b\",\n",
       "                    \"value\": 216\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8d22\\u7ecf\\u7c7b\",\n",
       "                    \"value\": 216\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u827a\\u672f\\u7c7b\",\n",
       "                    \"value\": 106\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u519c\\u6797\\u7c7b\",\n",
       "                    \"value\": 87\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u653f\\u6cd5\\u7c7b\",\n",
       "                    \"value\": 68\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u519b\\u4e8b\\u7c7b\",\n",
       "                    \"value\": 55\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5176\\u4ed6\",\n",
       "                    \"value\": 55\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8bed\\u8a00\\u7c7b\",\n",
       "                    \"value\": 38\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4f53\\u80b2\\u7c7b\",\n",
       "                    \"value\": 35\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c11\\u65cf\\u7c7b\",\n",
       "                    \"value\": 15\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"0%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}: {c}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u7406\\u5de5\\u7c7b\",\n",
       "                \"\\u7efc\\u5408\\u7c7b\",\n",
       "                \"\\u5e08\\u8303\\u7c7b\",\n",
       "                \"\\u533b\\u836f\\u7c7b\",\n",
       "                \"\\u8d22\\u7ecf\\u7c7b\",\n",
       "                \"\\u827a\\u672f\\u7c7b\",\n",
       "                \"\\u519c\\u6797\\u7c7b\",\n",
       "                \"\\u653f\\u6cd5\\u7c7b\",\n",
       "                \"\\u519b\\u4e8b\\u7c7b\",\n",
       "                \"\\u5176\\u4ed6\",\n",
       "                \"\\u8bed\\u8a00\\u7c7b\",\n",
       "                \"\\u4f53\\u80b2\\u7c7b\",\n",
       "                \"\\u6c11\\u65cf\\u7c7b\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"left\": \"2%\",\n",
       "            \"top\": \"15%\",\n",
       "            \"orient\": \"vertical\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u529e\\u5b66\\u7c7b\\u522b\\u5360\\u6bd4\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_da4a9534ff734f29bdf132adbef9c735.setOption(option_da4a9534ff734f29bdf132adbef9c735);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1dca7e2b610>"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = (\n",
    "    Pie(init_opts=opts.InitOpts(theme=ThemeType.ESSOS))\n",
    "    .add(\n",
    "        \"\",\n",
    "        [list(z) for z in zip(l,v)],\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"办学类别占比\"),\n",
    "        legend_opts=opts.LegendOpts(orient=\"vertical\", pos_top=\"15%\", pos_left=\"2%\"),\n",
    "    )\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}: {c}\"))\n",
    ")\n",
    "c.render_notebook()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 985，211，双一流院校数量对比"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 统计985，211，双一流院校数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "46 126 148\n"
     ]
    }
   ],
   "source": [
    "su_985 = df_学校[df_学校['985'] == '是'].shape[0]\n",
    "su_211 = df_学校[df_学校['211'] == '是'].shape[0]\n",
    "su_yiliu = int(df_学校['双一流'].value_counts().values[0])\n",
    "print(su_985,su_211,su_yiliu)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [],
   "source": [
    "重点院校类别_list = ['985','211','双一流']\n",
    "重点院校数量_list = [su_985,su_211,su_yiliu]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>重点院校类别</th>\n",
       "      <th>重点院校数量</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>985</td>\n",
       "      <td>46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>211</td>\n",
       "      <td>126</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>双一流</td>\n",
       "      <td>148</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  重点院校类别  重点院校数量\n",
       "0    985      46\n",
       "1    211     126\n",
       "2    双一流     148"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_重点院校数量 = pd.DataFrame({'重点院校类别':重点院校类别_list,'重点院校数量':重点院校数量_list})\n",
    "df_重点院校数量"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 绘制重点院校数量可视化图\n",
    "- 使用pyecharts的Bar函数绘制柱状图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'essos':'https://assets.pyecharts.org/assets/themes/essos'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"5b4164eb87524683a1fd4bf75e68c37b\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'essos'], function(echarts) {\n",
       "                var chart_5b4164eb87524683a1fd4bf75e68c37b = echarts.init(\n",
       "                    document.getElementById('5b4164eb87524683a1fd4bf75e68c37b'), 'essos', {renderer: 'canvas'});\n",
       "                var option_5b4164eb87524683a1fd4bf75e68c37b = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                46,\n",
       "                126,\n",
       "                148\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"985\",\n",
       "                \"211\",\n",
       "                \"\\u53cc\\u4e00\\u6d41\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u91cd\\u70b9\\u5927\\u5b66\\u6570\\u91cf\\u5bf9\\u6bd4\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_5b4164eb87524683a1fd4bf75e68c37b.setOption(option_5b4164eb87524683a1fd4bf75e68c37b);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1dcabc92190>"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = (\n",
    "    Bar(init_opts=opts.InitOpts(theme=ThemeType.ESSOS))\n",
    "    .add_xaxis(['985','211','双一流'])\n",
    "    .add_yaxis(\"\",[su_985,su_211,su_yiliu])\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"重点大学数量对比\"))\n",
    "\n",
    ")\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 分析985，211，双一流分布情况"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 统计985，211，双一流学校及分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>城市</th>\n",
       "      <th>地址</th>\n",
       "      <th>水平层次</th>\n",
       "      <th>办学类别</th>\n",
       "      <th>办学类型</th>\n",
       "      <th>985</th>\n",
       "      <th>211</th>\n",
       "      <th>双一流</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>省份</th>\n",
       "      <th>学校</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">上海</th>\n",
       "      <th>上海交通大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市东川路800号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>华东师范大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市中山北路3663号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>师范类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>同济大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市四平路1239号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>复旦大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市杨浦区邯郸路220号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>复旦大学上海医学院</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市医学院路138号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>医药类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"9\" valign=\"top\">北京</th>\n",
       "      <th>中国人民大学</th>\n",
       "      <td>北京市</td>\n",
       "      <td>北京市海淀区中关村大街59号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>中国农业大学</th>\n",
       "      <td>北京市</td>\n",
       "      <td>北京市海淀区清华东路17号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>农林类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>中央民族大学</th>\n",
       "      <td>北京市</td>\n",
       "      <td>北京市海淀区中关村南大街27号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>民族类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>北京大学</th>\n",
       "      <td>北京市</td>\n",
       "      <td>北京市海淀区颐和园路5号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>北京大学医学部</th>\n",
       "      <td>北京市</td>\n",
       "      <td>北京市海淀区学院路38号北京大学医学部</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>医药类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>北京师范大学</th>\n",
       "      <td>北京市</td>\n",
       "      <td>北太平庄校区北京市新街口外大街19号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>师范类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>北京理工大学</th>\n",
       "      <td>北京市</td>\n",
       "      <td>北京市海淀区中关村南大街5号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>北京航空航天大学</th>\n",
       "      <td>北京市</td>\n",
       "      <td>学院路校区：北京市海淀区学院路37号;沙河校区：北京市昌平区沙河高教园区</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>清华大学</th>\n",
       "      <td>北京市</td>\n",
       "      <td>北京市海淀区清华园1号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>吉林</th>\n",
       "      <th>吉林大学</th>\n",
       "      <td>长春市</td>\n",
       "      <td>前卫南区：长春市前进大街2699号;前卫北区：长春市解放大路123号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">四川</th>\n",
       "      <th>四川大学</th>\n",
       "      <td>成都市</td>\n",
       "      <td>四川省成都市一环路南一段24号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>电子科技大学</th>\n",
       "      <td>成都市</td>\n",
       "      <td>成都市高新区（西区）西源大道2006号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>电子科技大学格拉斯哥学院</th>\n",
       "      <td>成都市</td>\n",
       "      <td>成都市高新区（西区）西源大道2006号电子科技大学主楼A1区3楼</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>中外合作办学</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">天津</th>\n",
       "      <th>南开大学</th>\n",
       "      <td>天津市</td>\n",
       "      <td>天津市南开区卫津路94号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>天津大学</th>\n",
       "      <td>天津市</td>\n",
       "      <td>天津市南开区卫津路92号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>安徽</th>\n",
       "      <th>中国科学技术大学</th>\n",
       "      <td>合肥市</td>\n",
       "      <td>安徽省合肥市金寨路96号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"4\" valign=\"top\">山东</th>\n",
       "      <th>中国海洋大学</th>\n",
       "      <td>青岛市</td>\n",
       "      <td>山东省青岛市崂山区松岭路238号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>哈尔滨工业大学（威海）</th>\n",
       "      <td>威海市</td>\n",
       "      <td>山东省威海市环翠区文化西路2号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>山东大学</th>\n",
       "      <td>济南市</td>\n",
       "      <td>山东省济南市山大南路27号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>山东大学（威海）</th>\n",
       "      <td>威海市</td>\n",
       "      <td>山东省威海市环翠区文化西路180号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">广东</th>\n",
       "      <th>中山大学</th>\n",
       "      <td>广州市</td>\n",
       "      <td>广东省广州市新港西路135号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>华南理工大学</th>\n",
       "      <td>广州市</td>\n",
       "      <td>广东省广州市天河区五山路381号（五山校区）,广州市番禺区广州大学城外环东路382号（大学城...</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>哈尔滨工业大学（深圳）</th>\n",
       "      <td>深圳市</td>\n",
       "      <td>广东省深圳市南山区西丽深圳大学城哈工大深圳研究生院B栋202A室</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">江苏</th>\n",
       "      <th>东南大学</th>\n",
       "      <td>南京市</td>\n",
       "      <td>南京市江宁区东南大学路2号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>南京大学</th>\n",
       "      <td>南京市</td>\n",
       "      <td>仙林校区地址：江苏省南京市仙林大道163号;鼓楼校区地址：江苏省南京市汉口路22号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>河北</th>\n",
       "      <th>东北大学秦皇岛分校</th>\n",
       "      <td>秦皇岛市</td>\n",
       "      <td>河北省秦皇岛经济技术开发区泰山路143号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>浙江</th>\n",
       "      <th>浙江大学</th>\n",
       "      <td>杭州市</td>\n",
       "      <td>浙江省杭州市西湖区余杭塘路388号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">湖北</th>\n",
       "      <th>华中科技大学</th>\n",
       "      <td>武汉市</td>\n",
       "      <td>湖北省武汉市洪山区珞喻路1037号;湖北省武汉市汉口航空路13号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>武汉大学</th>\n",
       "      <td>武汉市</td>\n",
       "      <td>湖北省武汉市武昌区八一路299号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">湖南</th>\n",
       "      <th>中南大学</th>\n",
       "      <td>长沙市</td>\n",
       "      <td>湖南省长沙市麓山南路932号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>国防科技大学</th>\n",
       "      <td>长沙市</td>\n",
       "      <td>湖南省长沙市国防科学技术大学招生办公室</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>军事类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>湖南大学</th>\n",
       "      <td>长沙市</td>\n",
       "      <td>湖南省长沙市岳麓区麓山南路麓山门</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>甘肃</th>\n",
       "      <th>兰州大学</th>\n",
       "      <td>兰州市</td>\n",
       "      <td>兰州市天水南路222号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>福建</th>\n",
       "      <th>厦门大学</th>\n",
       "      <td>厦门市</td>\n",
       "      <td>福建省厦门市思明区思明南路422号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">辽宁</th>\n",
       "      <th>东北大学</th>\n",
       "      <td>沈阳市</td>\n",
       "      <td>辽宁省沈阳市和平区文化路三巷11号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>大连理工大学</th>\n",
       "      <td>大连市</td>\n",
       "      <td>辽宁省大连市甘井子区凌工路2号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>重庆</th>\n",
       "      <th>重庆大学</th>\n",
       "      <td>重庆市</td>\n",
       "      <td>重庆市沙坪坝区沙正街174号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">陕西</th>\n",
       "      <th>西北农林科技大学</th>\n",
       "      <td>咸阳市</td>\n",
       "      <td>陕西杨凌国家农业高新技术产业示范区西农路22号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>农林类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>西北工业大学</th>\n",
       "      <td>西安市</td>\n",
       "      <td>西安市友谊西路127号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>西安交通大学</th>\n",
       "      <td>西安市</td>\n",
       "      <td>西安市咸宁西路28号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>黑龙江</th>\n",
       "      <th>哈尔滨工业大学</th>\n",
       "      <td>哈尔滨市</td>\n",
       "      <td>黑龙江省哈尔滨市南岗区西大直街92号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                    城市                                                 地址  \\\n",
       "省份  学校                                                                      \n",
       "上海  上海交通大学         上海市                                         上海市东川路800号   \n",
       "    华东师范大学         上海市                                       上海市中山北路3663号   \n",
       "    同济大学           上海市                                        上海市四平路1239号   \n",
       "    复旦大学           上海市                                      上海市杨浦区邯郸路220号   \n",
       "    复旦大学上海医学院      上海市                                        上海市医学院路138号   \n",
       "北京  中国人民大学         北京市                                     北京市海淀区中关村大街59号   \n",
       "    中国农业大学         北京市                                      北京市海淀区清华东路17号   \n",
       "    中央民族大学         北京市                                    北京市海淀区中关村南大街27号   \n",
       "    北京大学           北京市                                       北京市海淀区颐和园路5号   \n",
       "    北京大学医学部        北京市                                北京市海淀区学院路38号北京大学医学部   \n",
       "    北京师范大学         北京市                                 北太平庄校区北京市新街口外大街19号   \n",
       "    北京理工大学         北京市                                     北京市海淀区中关村南大街5号   \n",
       "    北京航空航天大学       北京市               学院路校区：北京市海淀区学院路37号;沙河校区：北京市昌平区沙河高教园区   \n",
       "    清华大学           北京市                                        北京市海淀区清华园1号   \n",
       "吉林  吉林大学           长春市                 前卫南区：长春市前进大街2699号;前卫北区：长春市解放大路123号   \n",
       "四川  四川大学           成都市                                    四川省成都市一环路南一段24号   \n",
       "    电子科技大学         成都市                                成都市高新区（西区）西源大道2006号   \n",
       "    电子科技大学格拉斯哥学院   成都市                   成都市高新区（西区）西源大道2006号电子科技大学主楼A1区3楼   \n",
       "天津  南开大学           天津市                                       天津市南开区卫津路94号   \n",
       "    天津大学           天津市                                       天津市南开区卫津路92号   \n",
       "安徽  中国科学技术大学       合肥市                                       安徽省合肥市金寨路96号   \n",
       "山东  中国海洋大学         青岛市                                   山东省青岛市崂山区松岭路238号   \n",
       "    哈尔滨工业大学（威海）    威海市                                    山东省威海市环翠区文化西路2号   \n",
       "    山东大学           济南市                                      山东省济南市山大南路27号   \n",
       "    山东大学（威海）       威海市                                  山东省威海市环翠区文化西路180号   \n",
       "广东  中山大学           广州市                                     广东省广州市新港西路135号   \n",
       "    华南理工大学         广州市  广东省广州市天河区五山路381号（五山校区）,广州市番禺区广州大学城外环东路382号（大学城...   \n",
       "    哈尔滨工业大学（深圳）    深圳市                   广东省深圳市南山区西丽深圳大学城哈工大深圳研究生院B栋202A室   \n",
       "江苏  东南大学           南京市                                      南京市江宁区东南大学路2号   \n",
       "    南京大学           南京市          仙林校区地址：江苏省南京市仙林大道163号;鼓楼校区地址：江苏省南京市汉口路22号   \n",
       "河北  东北大学秦皇岛分校     秦皇岛市                               河北省秦皇岛经济技术开发区泰山路143号   \n",
       "浙江  浙江大学           杭州市                                  浙江省杭州市西湖区余杭塘路388号   \n",
       "湖北  华中科技大学         武汉市                   湖北省武汉市洪山区珞喻路1037号;湖北省武汉市汉口航空路13号   \n",
       "    武汉大学           武汉市                                   湖北省武汉市武昌区八一路299号   \n",
       "湖南  中南大学           长沙市                                     湖南省长沙市麓山南路932号   \n",
       "    国防科技大学         长沙市                                湖南省长沙市国防科学技术大学招生办公室   \n",
       "    湖南大学           长沙市                                   湖南省长沙市岳麓区麓山南路麓山门   \n",
       "甘肃  兰州大学           兰州市                                        兰州市天水南路222号   \n",
       "福建  厦门大学           厦门市                                  福建省厦门市思明区思明南路422号   \n",
       "辽宁  东北大学           沈阳市                                  辽宁省沈阳市和平区文化路三巷11号   \n",
       "    大连理工大学         大连市                                    辽宁省大连市甘井子区凌工路2号   \n",
       "重庆  重庆大学           重庆市                                     重庆市沙坪坝区沙正街174号   \n",
       "陕西  西北农林科技大学       咸阳市                            陕西杨凌国家农业高新技术产业示范区西农路22号   \n",
       "    西北工业大学         西安市                                        西安市友谊西路127号   \n",
       "    西安交通大学         西安市                                         西安市咸宁西路28号   \n",
       "黑龙江 哈尔滨工业大学       哈尔滨市                                 黑龙江省哈尔滨市南岗区西大直街92号   \n",
       "\n",
       "                  水平层次 办学类别    办学类型 985 211 双一流  \n",
       "省份  学校                                           \n",
       "上海  上海交通大学        普通本科  综合类      公办   是   是   是  \n",
       "    华东师范大学        普通本科  师范类      公办   是   是   是  \n",
       "    同济大学          普通本科  综合类      公办   是   是   是  \n",
       "    复旦大学          普通本科  综合类      公办   是   是   是  \n",
       "    复旦大学上海医学院     普通本科  医药类      公办   是   是   0  \n",
       "北京  中国人民大学        普通本科  综合类      公办   是   是   是  \n",
       "    中国农业大学        普通本科  农林类      公办   是   是   是  \n",
       "    中央民族大学        普通本科  民族类      公办   是   是   是  \n",
       "    北京大学          普通本科  综合类      公办   是   是   是  \n",
       "    北京大学医学部       普通本科  医药类      公办   是   是   0  \n",
       "    北京师范大学        普通本科  师范类      公办   是   是   是  \n",
       "    北京理工大学        普通本科  理工类      公办   是   是   是  \n",
       "    北京航空航天大学      普通本科  理工类      公办   是   是   是  \n",
       "    清华大学          普通本科  综合类      公办   是   是   是  \n",
       "吉林  吉林大学          普通本科  综合类      公办   是   是   是  \n",
       "四川  四川大学          普通本科  综合类      公办   是   是   是  \n",
       "    电子科技大学        普通本科  理工类      公办   是   是   是  \n",
       "    电子科技大学格拉斯哥学院  普通本科  理工类  中外合作办学   是   是   是  \n",
       "天津  南开大学          普通本科  综合类      公办   是   是   是  \n",
       "    天津大学          普通本科  理工类      公办   是   是   是  \n",
       "安徽  中国科学技术大学      普通本科  理工类      公办   是   是   是  \n",
       "山东  中国海洋大学        普通本科  综合类      公办   是   是   是  \n",
       "    哈尔滨工业大学（威海）   普通本科  理工类      公办   是   是   是  \n",
       "    山东大学          普通本科  综合类      公办   是   是   是  \n",
       "    山东大学（威海）      普通本科  综合类      公办   是   是   是  \n",
       "广东  中山大学          普通本科  综合类      公办   是   是   是  \n",
       "    华南理工大学        普通本科  理工类      公办   是   是   是  \n",
       "    哈尔滨工业大学（深圳）   普通本科  理工类      公办   是   是   是  \n",
       "江苏  东南大学          普通本科  综合类      公办   是   是   是  \n",
       "    南京大学          普通本科  综合类      公办   是   是   是  \n",
       "河北  东北大学秦皇岛分校     普通本科  理工类      公办   是   是   0  \n",
       "浙江  浙江大学          普通本科  综合类      公办   是   是   是  \n",
       "湖北  华中科技大学        普通本科  理工类      公办   是   是   是  \n",
       "    武汉大学          普通本科  综合类      公办   是   是   是  \n",
       "湖南  中南大学          普通本科  综合类      公办   是   是   是  \n",
       "    国防科技大学        普通本科  军事类      公办   是   是   是  \n",
       "    湖南大学          普通本科  综合类      公办   是   是   是  \n",
       "甘肃  兰州大学          普通本科  综合类      公办   是   是   是  \n",
       "福建  厦门大学          普通本科  综合类      公办   是   是   是  \n",
       "辽宁  东北大学          普通本科  理工类      公办   是   是   是  \n",
       "    大连理工大学        普通本科  理工类      公办   是   是   是  \n",
       "重庆  重庆大学          普通本科  综合类      公办   是   是   是  \n",
       "陕西  西北农林科技大学      普通本科  农林类      公办   是   是   是  \n",
       "    西北工业大学        普通本科  理工类      公办   是   是   是  \n",
       "    西安交通大学        普通本科  综合类      公办   是   是   是  \n",
       "黑龙江 哈尔滨工业大学       普通本科  理工类      公办   是   是   是  "
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 统计985学校及分布\n",
    "df_985 = df_学校[df_学校['985'] == '是']\n",
    "df_985学校及分布 = df_985.groupby(['省份','学校']).sum()\n",
    "df_985学校及分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>城市</th>\n",
       "      <th>地址</th>\n",
       "      <th>水平层次</th>\n",
       "      <th>办学类别</th>\n",
       "      <th>办学类型</th>\n",
       "      <th>985</th>\n",
       "      <th>211</th>\n",
       "      <th>双一流</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>省份</th>\n",
       "      <th>学校</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">上海</th>\n",
       "      <th>上海交通大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市东川路800号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>上海外国语大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市虹口区大连西路550号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>语言类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>上海大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>宝山校区：上海市宝山区上大路99号;延长校区：上海市静安区延长路149号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>上海财经大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市杨浦区国定路777号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>财经类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>东华大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市延安西路1882号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>青海</th>\n",
       "      <th>青海大学</th>\n",
       "      <td>西宁市</td>\n",
       "      <td>青海省西宁市宁大路251号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"4\" valign=\"top\">黑龙江</th>\n",
       "      <th>东北农业大学</th>\n",
       "      <td>哈尔滨市</td>\n",
       "      <td>黑龙江省哈尔滨市香坊区长江路600号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>农林类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>东北林业大学</th>\n",
       "      <td>哈尔滨市</td>\n",
       "      <td>黑龙江省哈尔滨市香坊区和兴路26号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>农林类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>哈尔滨工业大学</th>\n",
       "      <td>哈尔滨市</td>\n",
       "      <td>黑龙江省哈尔滨市南岗区西大直街92号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>哈尔滨工程大学</th>\n",
       "      <td>哈尔滨市</td>\n",
       "      <td>哈尔滨市南岗区南通大街145号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>126 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               城市                                    地址  水平层次 办学类别 办学类型 985  \\\n",
       "省份  学校                                                                        \n",
       "上海  上海交通大学    上海市                            上海市东川路800号  普通本科  综合类   公办   是   \n",
       "    上海外国语大学   上海市                        上海市虹口区大连西路550号  普通本科  语言类   公办   否   \n",
       "    上海大学      上海市  宝山校区：上海市宝山区上大路99号;延长校区：上海市静安区延长路149号  普通本科  综合类   公办   否   \n",
       "    上海财经大学    上海市                         上海市杨浦区国定路777号  普通本科  财经类   公办   否   \n",
       "    东华大学      上海市                          上海市延安西路1882号  普通本科  理工类   公办   否   \n",
       "...           ...                                   ...   ...  ...  ...  ..   \n",
       "青海  青海大学      西宁市                         青海省西宁市宁大路251号  普通本科  综合类   公办   否   \n",
       "黑龙江 东北农业大学   哈尔滨市                    黑龙江省哈尔滨市香坊区长江路600号  普通本科  农林类   公办   否   \n",
       "    东北林业大学   哈尔滨市                     黑龙江省哈尔滨市香坊区和兴路26号  普通本科  农林类   公办   否   \n",
       "    哈尔滨工业大学  哈尔滨市                    黑龙江省哈尔滨市南岗区西大直街92号  普通本科  理工类   公办   是   \n",
       "    哈尔滨工程大学  哈尔滨市                       哈尔滨市南岗区南通大街145号  普通本科  理工类   公办   否   \n",
       "\n",
       "            211 双一流  \n",
       "省份  学校               \n",
       "上海  上海交通大学    是   是  \n",
       "    上海外国语大学   是   是  \n",
       "    上海大学      是   是  \n",
       "    上海财经大学    是   是  \n",
       "    东华大学      是   是  \n",
       "...          ..  ..  \n",
       "青海  青海大学      是   是  \n",
       "黑龙江 东北农业大学    是   是  \n",
       "    东北林业大学    是   是  \n",
       "    哈尔滨工业大学   是   是  \n",
       "    哈尔滨工程大学   是   是  \n",
       "\n",
       "[126 rows x 8 columns]"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 统计211学校及分布\n",
    "df_211 = df_学校[df_学校['211'] == '是']\n",
    "df_211学校及分布 = df_211.groupby(['省份','学校']).sum()\n",
    "df_211学校及分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>城市</th>\n",
       "      <th>地址</th>\n",
       "      <th>水平层次</th>\n",
       "      <th>办学类别</th>\n",
       "      <th>办学类型</th>\n",
       "      <th>985</th>\n",
       "      <th>211</th>\n",
       "      <th>双一流</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>省份</th>\n",
       "      <th>学校</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">上海</th>\n",
       "      <th>上海中医药大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市浦东新区蔡伦路1200号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>医药类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>上海交通大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市东川路800号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>上海体育学院</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市杨浦区清源环路650号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>体育类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>上海外国语大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市虹口区大连西路550号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>语言类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>上海大学</th>\n",
       "      <td>上海市</td>\n",
       "      <td>宝山校区：上海市宝山区上大路99号;延长校区：上海市静安区延长路149号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>青海</th>\n",
       "      <th>青海大学</th>\n",
       "      <td>西宁市</td>\n",
       "      <td>青海省西宁市宁大路251号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>综合类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"4\" valign=\"top\">黑龙江</th>\n",
       "      <th>东北农业大学</th>\n",
       "      <td>哈尔滨市</td>\n",
       "      <td>黑龙江省哈尔滨市香坊区长江路600号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>农林类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>东北林业大学</th>\n",
       "      <td>哈尔滨市</td>\n",
       "      <td>黑龙江省哈尔滨市香坊区和兴路26号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>农林类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>哈尔滨工业大学</th>\n",
       "      <td>哈尔滨市</td>\n",
       "      <td>黑龙江省哈尔滨市南岗区西大直街92号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>哈尔滨工程大学</th>\n",
       "      <td>哈尔滨市</td>\n",
       "      <td>哈尔滨市南岗区南通大街145号</td>\n",
       "      <td>普通本科</td>\n",
       "      <td>理工类</td>\n",
       "      <td>公办</td>\n",
       "      <td>否</td>\n",
       "      <td>是</td>\n",
       "      <td>是</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>148 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               城市                                    地址  水平层次 办学类别 办学类型 985  \\\n",
       "省份  学校                                                                        \n",
       "上海  上海中医药大学   上海市                       上海市浦东新区蔡伦路1200号  普通本科  医药类   公办   否   \n",
       "    上海交通大学    上海市                            上海市东川路800号  普通本科  综合类   公办   是   \n",
       "    上海体育学院    上海市                        上海市杨浦区清源环路650号  普通本科  体育类   公办   否   \n",
       "    上海外国语大学   上海市                        上海市虹口区大连西路550号  普通本科  语言类   公办   否   \n",
       "    上海大学      上海市  宝山校区：上海市宝山区上大路99号;延长校区：上海市静安区延长路149号  普通本科  综合类   公办   否   \n",
       "...           ...                                   ...   ...  ...  ...  ..   \n",
       "青海  青海大学      西宁市                         青海省西宁市宁大路251号  普通本科  综合类   公办   否   \n",
       "黑龙江 东北农业大学   哈尔滨市                    黑龙江省哈尔滨市香坊区长江路600号  普通本科  农林类   公办   否   \n",
       "    东北林业大学   哈尔滨市                     黑龙江省哈尔滨市香坊区和兴路26号  普通本科  农林类   公办   否   \n",
       "    哈尔滨工业大学  哈尔滨市                    黑龙江省哈尔滨市南岗区西大直街92号  普通本科  理工类   公办   是   \n",
       "    哈尔滨工程大学  哈尔滨市                       哈尔滨市南岗区南通大街145号  普通本科  理工类   公办   否   \n",
       "\n",
       "            211 双一流  \n",
       "省份  学校               \n",
       "上海  上海中医药大学   否   是  \n",
       "    上海交通大学    是   是  \n",
       "    上海体育学院    否   是  \n",
       "    上海外国语大学   是   是  \n",
       "    上海大学      是   是  \n",
       "...          ..  ..  \n",
       "青海  青海大学      是   是  \n",
       "黑龙江 东北农业大学    是   是  \n",
       "    东北林业大学    是   是  \n",
       "    哈尔滨工业大学   是   是  \n",
       "    哈尔滨工程大学   是   是  \n",
       "\n",
       "[148 rows x 8 columns]"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 统计双一流学校及分布\n",
    "df_双一流 = df_学校[df_学校['双一流'] == '是']\n",
    "df_双一流学校及分布 = df_双一流.groupby(['省份','学校']).sum()\n",
    "df_双一流学校及分布"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 绘制重点学校分布可视化图\n",
    "- 使用pyecharts的Bar函数绘制条形图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'essos':'https://assets.pyecharts.org/assets/themes/essos'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"00c9970bee044a06b13e53375d5b68d1\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'essos'], function(echarts) {\n",
       "                var chart_00c9970bee044a06b13e53375d5b68d1 = echarts.init(\n",
       "                    document.getElementById('00c9970bee044a06b13e53375d5b68d1'), 'essos', {renderer: 'canvas'});\n",
       "                var option_00c9970bee044a06b13e53375d5b68d1 = {\n",
       "    \"baseOption\": {\n",
       "        \"series\": [\n",
       "            {\n",
       "                \"type\": \"bar\",\n",
       "                \"name\": \"\\u6570\\u91cf\",\n",
       "                \"legendHoverLink\": true,\n",
       "                \"data\": [\n",
       "                    4,\n",
       "                    5,\n",
       "                    6,\n",
       "                    6,\n",
       "                    7,\n",
       "                    7,\n",
       "                    9,\n",
       "                    14,\n",
       "                    16,\n",
       "                    35\n",
       "                ],\n",
       "                \"showBackground\": false,\n",
       "                \"barMinHeight\": 0,\n",
       "                \"barCategoryGap\": \"20%\",\n",
       "                \"barGap\": \"30%\",\n",
       "                \"large\": false,\n",
       "                \"largeThreshold\": 400,\n",
       "                \"seriesLayoutBy\": \"column\",\n",
       "                \"datasetIndex\": 0,\n",
       "                \"clip\": true,\n",
       "                \"zlevel\": 0,\n",
       "                \"z\": 2,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"right\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            }\n",
       "        ],\n",
       "        \"timeline\": {\n",
       "            \"axisType\": \"category\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"autoPlay\": false,\n",
       "            \"controlPosition\": \"left\",\n",
       "            \"loop\": true,\n",
       "            \"rewind\": false,\n",
       "            \"show\": true,\n",
       "            \"inverse\": false,\n",
       "            \"bottom\": \"-5px\",\n",
       "            \"data\": [\n",
       "                \"985\",\n",
       "                \"211\",\n",
       "                \"\\u53cc\\u4e00\\u6d41\"\n",
       "            ]\n",
       "        },\n",
       "        \"xAxis\": [\n",
       "            {\n",
       "                \"show\": true,\n",
       "                \"scale\": false,\n",
       "                \"nameLocation\": \"end\",\n",
       "                \"nameGap\": 15,\n",
       "                \"gridIndex\": 0,\n",
       "                \"inverse\": false,\n",
       "                \"offset\": 0,\n",
       "                \"splitNumber\": 5,\n",
       "                \"minInterval\": 0,\n",
       "                \"splitLine\": {\n",
       "                    \"show\": false,\n",
       "                    \"lineStyle\": {\n",
       "                        \"show\": true,\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        ],\n",
       "        \"yAxis\": [\n",
       "            {\n",
       "                \"show\": true,\n",
       "                \"scale\": false,\n",
       "                \"nameLocation\": \"end\",\n",
       "                \"nameGap\": 15,\n",
       "                \"gridIndex\": 0,\n",
       "                \"inverse\": false,\n",
       "                \"offset\": 0,\n",
       "                \"splitNumber\": 5,\n",
       "                \"minInterval\": 0,\n",
       "                \"splitLine\": {\n",
       "                    \"show\": false,\n",
       "                    \"lineStyle\": {\n",
       "                        \"show\": true,\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    }\n",
       "                },\n",
       "                \"data\": [\n",
       "                    \"\\u6e56\\u5357\",\n",
       "                    \"\\u5c71\\u4e1c\",\n",
       "                    \"\\u5e7f\\u4e1c\",\n",
       "                    \"\\u5929\\u6d25\",\n",
       "                    \"\\u6e56\\u5317\",\n",
       "                    \"\\u9655\\u897f\",\n",
       "                    \"\\u56db\\u5ddd\",\n",
       "                    \"\\u4e0a\\u6d77\",\n",
       "                    \"\\u6c5f\\u82cf\",\n",
       "                    \"\\u5317\\u4eac\"\n",
       "                ]\n",
       "            }\n",
       "        ]\n",
       "    },\n",
       "    \"options\": [\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u6570\\u91cf\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u6570\\u91cf\": true\n",
       "                    },\n",
       "                    \"show\": true,\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10,\n",
       "                    \"itemWidth\": 25,\n",
       "                    \"itemHeight\": 14\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"type\": \"bar\",\n",
       "                    \"name\": \"\\u6570\\u91cf\",\n",
       "                    \"legendHoverLink\": true,\n",
       "                    \"data\": [\n",
       "                        2,\n",
       "                        2,\n",
       "                        2,\n",
       "                        3,\n",
       "                        3,\n",
       "                        3,\n",
       "                        3,\n",
       "                        4,\n",
       "                        5,\n",
       "                        9\n",
       "                    ],\n",
       "                    \"showBackground\": false,\n",
       "                    \"barMinHeight\": 0,\n",
       "                    \"barCategoryGap\": \"20%\",\n",
       "                    \"barGap\": \"30%\",\n",
       "                    \"large\": false,\n",
       "                    \"largeThreshold\": 400,\n",
       "                    \"seriesLayoutBy\": \"column\",\n",
       "                    \"datasetIndex\": 0,\n",
       "                    \"clip\": true,\n",
       "                    \"zlevel\": 0,\n",
       "                    \"z\": 2,\n",
       "                    \"label\": {\n",
       "                        \"show\": true,\n",
       "                        \"position\": \"right\",\n",
       "                        \"margin\": 8\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"yAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u6e56\\u5317\",\n",
       "                        \"\\u5929\\u6d25\",\n",
       "                        \"\\u8fbd\\u5b81\",\n",
       "                        \"\\u6e56\\u5357\",\n",
       "                        \"\\u5e7f\\u4e1c\",\n",
       "                        \"\\u9655\\u897f\",\n",
       "                        \"\\u56db\\u5ddd\",\n",
       "                        \"\\u5c71\\u4e1c\",\n",
       "                        \"\\u4e0a\\u6d77\",\n",
       "                        \"\\u5317\\u4eac\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"\\u91cd\\u70b9\\u5927\\u5b66\\u5206\\u5e03\\u8f6e\\u64ad\\u56fe\",\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u6570\\u91cf\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u6570\\u91cf\": true\n",
       "                    },\n",
       "                    \"show\": true,\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10,\n",
       "                    \"itemWidth\": 25,\n",
       "                    \"itemHeight\": 14\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"type\": \"bar\",\n",
       "                    \"name\": \"\\u6570\\u91cf\",\n",
       "                    \"legendHoverLink\": true,\n",
       "                    \"data\": [\n",
       "                        4,\n",
       "                        4,\n",
       "                        5,\n",
       "                        5,\n",
       "                        7,\n",
       "                        7,\n",
       "                        8,\n",
       "                        11,\n",
       "                        11,\n",
       "                        27\n",
       "                    ],\n",
       "                    \"showBackground\": false,\n",
       "                    \"barMinHeight\": 0,\n",
       "                    \"barCategoryGap\": \"20%\",\n",
       "                    \"barGap\": \"30%\",\n",
       "                    \"large\": false,\n",
       "                    \"largeThreshold\": 400,\n",
       "                    \"seriesLayoutBy\": \"column\",\n",
       "                    \"datasetIndex\": 0,\n",
       "                    \"clip\": true,\n",
       "                    \"zlevel\": 0,\n",
       "                    \"z\": 2,\n",
       "                    \"label\": {\n",
       "                        \"show\": true,\n",
       "                        \"position\": \"right\",\n",
       "                        \"margin\": 8\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"yAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u6e56\\u5357\",\n",
       "                        \"\\u5929\\u6d25\",\n",
       "                        \"\\u5e7f\\u4e1c\",\n",
       "                        \"\\u5c71\\u4e1c\",\n",
       "                        \"\\u6e56\\u5317\",\n",
       "                        \"\\u56db\\u5ddd\",\n",
       "                        \"\\u9655\\u897f\",\n",
       "                        \"\\u6c5f\\u82cf\",\n",
       "                        \"\\u4e0a\\u6d77\",\n",
       "                        \"\\u5317\\u4eac\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"\\u91cd\\u70b9\\u5927\\u5b66\\u5206\\u5e03\\u8f6e\\u64ad\\u56fe\",\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u6570\\u91cf\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u6570\\u91cf\": true\n",
       "                    },\n",
       "                    \"show\": true,\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10,\n",
       "                    \"itemWidth\": 25,\n",
       "                    \"itemHeight\": 14\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"type\": \"bar\",\n",
       "                    \"name\": \"\\u6570\\u91cf\",\n",
       "                    \"legendHoverLink\": true,\n",
       "                    \"data\": [\n",
       "                        4,\n",
       "                        5,\n",
       "                        6,\n",
       "                        6,\n",
       "                        7,\n",
       "                        7,\n",
       "                        9,\n",
       "                        14,\n",
       "                        16,\n",
       "                        35\n",
       "                    ],\n",
       "                    \"showBackground\": false,\n",
       "                    \"barMinHeight\": 0,\n",
       "                    \"barCategoryGap\": \"20%\",\n",
       "                    \"barGap\": \"30%\",\n",
       "                    \"large\": false,\n",
       "                    \"largeThreshold\": 400,\n",
       "                    \"seriesLayoutBy\": \"column\",\n",
       "                    \"datasetIndex\": 0,\n",
       "                    \"clip\": true,\n",
       "                    \"zlevel\": 0,\n",
       "                    \"z\": 2,\n",
       "                    \"label\": {\n",
       "                        \"show\": true,\n",
       "                        \"position\": \"right\",\n",
       "                        \"margin\": 8\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"yAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u6e56\\u5357\",\n",
       "                        \"\\u5c71\\u4e1c\",\n",
       "                        \"\\u5e7f\\u4e1c\",\n",
       "                        \"\\u5929\\u6d25\",\n",
       "                        \"\\u6e56\\u5317\",\n",
       "                        \"\\u9655\\u897f\",\n",
       "                        \"\\u56db\\u5ddd\",\n",
       "                        \"\\u4e0a\\u6d77\",\n",
       "                        \"\\u6c5f\\u82cf\",\n",
       "                        \"\\u5317\\u4eac\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"\\u91cd\\u70b9\\u5927\\u5b66\\u5206\\u5e03\\u8f6e\\u64ad\\u56fe\",\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_00c9970bee044a06b13e53375d5b68d1.setOption(option_00c9970bee044a06b13e53375d5b68d1);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1dcab5ed310>"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tl = Timeline(init_opts=opts.InitOpts(theme=ThemeType.ESSOS))\n",
    "for i in ['985','211','双一流']:\n",
    "    p_v = df_学校[df_学校[i] == '是']\n",
    "    p_v = p_v['省份'].value_counts().reset_index()[:10]\n",
    "    p = list(p_v['index'])[::-1]\n",
    "    v = list(p_v['省份'])[::-1]\n",
    "    bar = (\n",
    "        Bar(init_opts=opts.InitOpts(theme=ThemeType.ESSOS))\n",
    "        .add_xaxis(p)\n",
    "        .add_yaxis(\"数量\",v, label_opts=opts.LabelOpts(position=\"right\"))\n",
    "        .reversal_axis()\n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(\"重点大学分布轮播图\".format(i))\n",
    "        )\n",
    "    )\n",
    "    tl.add(bar, \"{}\".format(i))\n",
    "tl.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 分析开设数量前二十的专业"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学校</th>\n",
       "      <th>专业类别</th>\n",
       "      <th>专业名称</th>\n",
       "      <th>国家特色专业</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>河北轨道运输职业技术学院</td>\n",
       "      <td>测绘地理信息类(专)</td>\n",
       "      <td>测绘地理信息技术</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>河北轨道运输职业技术学院</td>\n",
       "      <td>土建施工类(专)</td>\n",
       "      <td>建筑工程技术</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>河北轨道运输职业技术学院</td>\n",
       "      <td>机械设计制造类(专)</td>\n",
       "      <td>数控技术</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>河北轨道运输职业技术学院</td>\n",
       "      <td>机电设备类(专)</td>\n",
       "      <td>电梯工程技术</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>河北轨道运输职业技术学院</td>\n",
       "      <td>自动化类(专)</td>\n",
       "      <td>机电一体化技术</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91895</th>\n",
       "      <td>林州建筑职业技术学院</td>\n",
       "      <td>建筑设计类(专)</td>\n",
       "      <td>建筑装饰工程技术</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91896</th>\n",
       "      <td>林州建筑职业技术学院</td>\n",
       "      <td>土建施工类(专)</td>\n",
       "      <td>建筑工程技术</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91897</th>\n",
       "      <td>林州建筑职业技术学院</td>\n",
       "      <td>建设工程管理类(专)</td>\n",
       "      <td>工程造价</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91898</th>\n",
       "      <td>林州建筑职业技术学院</td>\n",
       "      <td>建设工程管理类(专)</td>\n",
       "      <td>建设工程监理</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91899</th>\n",
       "      <td>林州建筑职业技术学院</td>\n",
       "      <td>财务会计类(专)</td>\n",
       "      <td>会计</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>91900 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                 学校        专业类别      专业名称 国家特色专业\n",
       "0      河北轨道运输职业技术学院  测绘地理信息类(专)  测绘地理信息技术    NaN\n",
       "1      河北轨道运输职业技术学院    土建施工类(专)    建筑工程技术    NaN\n",
       "2      河北轨道运输职业技术学院  机械设计制造类(专)      数控技术    NaN\n",
       "3      河北轨道运输职业技术学院    机电设备类(专)    电梯工程技术    NaN\n",
       "4      河北轨道运输职业技术学院     自动化类(专)   机电一体化技术    NaN\n",
       "...             ...         ...       ...    ...\n",
       "91895    林州建筑职业技术学院    建筑设计类(专)  建筑装饰工程技术    NaN\n",
       "91896    林州建筑职业技术学院    土建施工类(专)    建筑工程技术    NaN\n",
       "91897    林州建筑职业技术学院  建设工程管理类(专)      工程造价    NaN\n",
       "91898    林州建筑职业技术学院  建设工程管理类(专)    建设工程监理    NaN\n",
       "91899    林州建筑职业技术学院    财务会计类(专)        会计    NaN\n",
       "\n",
       "[91900 rows x 4 columns]"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_专业"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 获取开设数量前20的专业数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['市场营销', '电子商务', '物流管理', '旅游管理', '财务管理', '会计', '国际经济与贸易', '计算机科学与技术', '工程造价', '英语', '商务英语', '视觉传达设计', '酒店管理', '环境设计', '机电一体化技术', '学前教育', '电子信息工程', '会计学', '人力资源管理', '计算机应用技术'] [1279, 1209, 1053, 1041, 950, 857, 811, 808, 799, 783, 672, 656, 648, 644, 621, 610, 597, 588, 557, 557]\n"
     ]
    }
   ],
   "source": [
    "top20 = df_专业['专业名称'].value_counts().reset_index()\n",
    "专业名称 = list(top20['index'])[:20]\n",
    "数量 = list(top20['专业名称'])[:20]\n",
    "print(专业名称,数量)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 构建开设数量前20的专业数据表格"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>专业名称</th>\n",
       "      <th>开设总数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>市场营销</td>\n",
       "      <td>1279</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>电子商务</td>\n",
       "      <td>1209</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>物流管理</td>\n",
       "      <td>1053</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>旅游管理</td>\n",
       "      <td>1041</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>财务管理</td>\n",
       "      <td>950</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>会计</td>\n",
       "      <td>857</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>国际经济与贸易</td>\n",
       "      <td>811</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>计算机科学与技术</td>\n",
       "      <td>808</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>工程造价</td>\n",
       "      <td>799</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>英语</td>\n",
       "      <td>783</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>商务英语</td>\n",
       "      <td>672</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>视觉传达设计</td>\n",
       "      <td>656</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>酒店管理</td>\n",
       "      <td>648</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>环境设计</td>\n",
       "      <td>644</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>机电一体化技术</td>\n",
       "      <td>621</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>学前教育</td>\n",
       "      <td>610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>电子信息工程</td>\n",
       "      <td>597</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>会计学</td>\n",
       "      <td>588</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>人力资源管理</td>\n",
       "      <td>557</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>计算机应用技术</td>\n",
       "      <td>557</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        专业名称  开设总数\n",
       "0       市场营销  1279\n",
       "1       电子商务  1209\n",
       "2       物流管理  1053\n",
       "3       旅游管理  1041\n",
       "4       财务管理   950\n",
       "5         会计   857\n",
       "6    国际经济与贸易   811\n",
       "7   计算机科学与技术   808\n",
       "8       工程造价   799\n",
       "9         英语   783\n",
       "10      商务英语   672\n",
       "11    视觉传达设计   656\n",
       "12      酒店管理   648\n",
       "13      环境设计   644\n",
       "14   机电一体化技术   621\n",
       "15      学前教育   610\n",
       "16    电子信息工程   597\n",
       "17       会计学   588\n",
       "18    人力资源管理   557\n",
       "19   计算机应用技术   557"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_top20专业 = pd.DataFrame({'专业名称':专业名称,'开设总数':数量})\n",
    "df_top20专业"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 绘制开设数量前20的专业可视化图\n",
    "- 使用pyecharts的Bar函数绘制柱状图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'essos':'https://assets.pyecharts.org/assets/themes/essos'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"659707684a1f42dcbebcad6b7aba5996\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'essos'], function(echarts) {\n",
       "                var chart_659707684a1f42dcbebcad6b7aba5996 = echarts.init(\n",
       "                    document.getElementById('659707684a1f42dcbebcad6b7aba5996'), 'essos', {renderer: 'canvas'});\n",
       "                var option_659707684a1f42dcbebcad6b7aba5996 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                1279,\n",
       "                1209,\n",
       "                1053,\n",
       "                1041,\n",
       "                950,\n",
       "                857,\n",
       "                811,\n",
       "                808,\n",
       "                799,\n",
       "                783,\n",
       "                672,\n",
       "                656,\n",
       "                648,\n",
       "                644,\n",
       "                621,\n",
       "                610,\n",
       "                597,\n",
       "                588,\n",
       "                557,\n",
       "                557\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"rotate\": -30,\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u5e02\\u573a\\u8425\\u9500\",\n",
       "                \"\\u7535\\u5b50\\u5546\\u52a1\",\n",
       "                \"\\u7269\\u6d41\\u7ba1\\u7406\",\n",
       "                \"\\u65c5\\u6e38\\u7ba1\\u7406\",\n",
       "                \"\\u8d22\\u52a1\\u7ba1\\u7406\",\n",
       "                \"\\u4f1a\\u8ba1\",\n",
       "                \"\\u56fd\\u9645\\u7ecf\\u6d4e\\u4e0e\\u8d38\\u6613\",\n",
       "                \"\\u8ba1\\u7b97\\u673a\\u79d1\\u5b66\\u4e0e\\u6280\\u672f\",\n",
       "                \"\\u5de5\\u7a0b\\u9020\\u4ef7\",\n",
       "                \"\\u82f1\\u8bed\",\n",
       "                \"\\u5546\\u52a1\\u82f1\\u8bed\",\n",
       "                \"\\u89c6\\u89c9\\u4f20\\u8fbe\\u8bbe\\u8ba1\",\n",
       "                \"\\u9152\\u5e97\\u7ba1\\u7406\",\n",
       "                \"\\u73af\\u5883\\u8bbe\\u8ba1\",\n",
       "                \"\\u673a\\u7535\\u4e00\\u4f53\\u5316\\u6280\\u672f\",\n",
       "                \"\\u5b66\\u524d\\u6559\\u80b2\",\n",
       "                \"\\u7535\\u5b50\\u4fe1\\u606f\\u5de5\\u7a0b\",\n",
       "                \"\\u4f1a\\u8ba1\\u5b66\",\n",
       "                \"\\u4eba\\u529b\\u8d44\\u6e90\\u7ba1\\u7406\",\n",
       "                \"\\u8ba1\\u7b97\\u673a\\u5e94\\u7528\\u6280\\u672f\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u5f00\\u8bbe\\u4e13\\u4e1atop20\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_659707684a1f42dcbebcad6b7aba5996.setOption(option_659707684a1f42dcbebcad6b7aba5996);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1dcabc0fd30>"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = (\n",
    "    Bar(init_opts=opts.InitOpts(theme=ThemeType.ESSOS))\n",
    "    .add_xaxis(\n",
    "        专业名称\n",
    "    )\n",
    "    .add_yaxis(\"\", 数量)\n",
    "    .set_global_opts(\n",
    "        xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(rotate=-30)),\n",
    "        title_opts=opts.TitleOpts(title=\"开设专业top20\"),\n",
    "    )\n",
    ")\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 分析国家特色专业学校分布情况"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 获取各学校国家特色专业数量数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学校</th>\n",
       "      <th>国家特色专业</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>107</th>\n",
       "      <td>北京大学</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>420</th>\n",
       "      <td>浙江大学</td>\n",
       "      <td>32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>上海交通大学</td>\n",
       "      <td>28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>349</th>\n",
       "      <td>武汉大学</td>\n",
       "      <td>28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>184</th>\n",
       "      <td>吉林大学</td>\n",
       "      <td>26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>500</th>\n",
       "      <td>福建警察学院</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>501</th>\n",
       "      <td>红河学院</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>503</th>\n",
       "      <td>绥化学院</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>203</th>\n",
       "      <td>嘉应学院</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>628</th>\n",
       "      <td>龙岩学院</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>629 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         学校  国家特色专业\n",
       "107    北京大学      41\n",
       "420    浙江大学      32\n",
       "4    上海交通大学      28\n",
       "349    武汉大学      28\n",
       "184    吉林大学      26\n",
       "..      ...     ...\n",
       "500  福建警察学院       1\n",
       "501    红河学院       1\n",
       "503    绥化学院       1\n",
       "203    嘉应学院       1\n",
       "628    龙岩学院       1\n",
       "\n",
       "[629 rows x 2 columns]"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tese = df_专业[df_专业['国家特色专业'] == '是']\n",
    "tese = tese.groupby('学校').count()['国家特色专业'].reset_index()\n",
    "tese = tese.sort_values(by='国家特色专业',ascending=False)\n",
    "tese"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 绘制国家特色专业数量排名前20的学校可视化图\n",
    "- 使用pyecharts的Bar函数绘制柱状图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [],
   "source": [
    "school = list(tese['学校'])[:20]\n",
    "values = list(tese['国家特色专业'])[:20]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'essos':'https://assets.pyecharts.org/assets/themes/essos'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"102c18689e5f4dc8b782f2f527b8b50e\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'essos'], function(echarts) {\n",
       "                var chart_102c18689e5f4dc8b782f2f527b8b50e = echarts.init(\n",
       "                    document.getElementById('102c18689e5f4dc8b782f2f527b8b50e'), 'essos', {renderer: 'canvas'});\n",
       "                var option_102c18689e5f4dc8b782f2f527b8b50e = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                41,\n",
       "                32,\n",
       "                28,\n",
       "                28,\n",
       "                26,\n",
       "                25,\n",
       "                25,\n",
       "                24,\n",
       "                22,\n",
       "                22,\n",
       "                21,\n",
       "                21,\n",
       "                20,\n",
       "                19,\n",
       "                19,\n",
       "                19,\n",
       "                19,\n",
       "                18,\n",
       "                18,\n",
       "                18\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"rotate\": -30,\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u5317\\u4eac\\u5927\\u5b66\",\n",
       "                \"\\u6d59\\u6c5f\\u5927\\u5b66\",\n",
       "                \"\\u4e0a\\u6d77\\u4ea4\\u901a\\u5927\\u5b66\",\n",
       "                \"\\u6b66\\u6c49\\u5927\\u5b66\",\n",
       "                \"\\u5409\\u6797\\u5927\\u5b66\",\n",
       "                \"\\u5929\\u6d25\\u5927\\u5b66\",\n",
       "                \"\\u5c71\\u4e1c\\u5927\\u5b66\",\n",
       "                \"\\u534e\\u4e2d\\u79d1\\u6280\\u5927\\u5b66\",\n",
       "                \"\\u56db\\u5ddd\\u5927\\u5b66\",\n",
       "                \"\\u6e05\\u534e\\u5927\\u5b66\",\n",
       "                \"\\u5927\\u8fde\\u7406\\u5de5\\u5927\\u5b66\",\n",
       "                \"\\u897f\\u5b89\\u4ea4\\u901a\\u5927\\u5b66\",\n",
       "                \"\\u5357\\u4eac\\u5927\\u5b66\",\n",
       "                \"\\u897f\\u5357\\u5927\\u5b66\",\n",
       "                \"\\u4e2d\\u5357\\u5927\\u5b66\",\n",
       "                \"\\u54c8\\u5c14\\u6ee8\\u5de5\\u4e1a\\u5927\\u5b66\",\n",
       "                \"\\u5317\\u4eac\\u5916\\u56fd\\u8bed\\u5927\\u5b66\",\n",
       "                \"\\u540c\\u6d4e\\u5927\\u5b66\",\n",
       "                \"\\u534e\\u5357\\u7406\\u5de5\\u5927\\u5b66\",\n",
       "                \"\\u4e2d\\u56fd\\u4eba\\u6c11\\u5927\\u5b66\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u7279\\u8272\\u4e13\\u4e1atop20\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_102c18689e5f4dc8b782f2f527b8b50e.setOption(option_102c18689e5f4dc8b782f2f527b8b50e);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1dcab9a1af0>"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = (\n",
    "    Bar(init_opts=opts.InitOpts(theme=ThemeType.ESSOS))\n",
    "    .add_xaxis(\n",
    "        school\n",
    "    )\n",
    "    .add_yaxis(\"\", values)\n",
    "    .set_global_opts(\n",
    "        xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(rotate=-30)),\n",
    "        title_opts=opts.TitleOpts(title=\"特色专业top20\"),\n",
    "    )\n",
    ")\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "318.306px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
